package com.wgworkshop.pems.model;

import com.wgworkshop.pems.checkgroup.CreateCheckGroup;
import com.wgworkshop.pems.checkgroup.PatchCheckGroup;
import com.wgworkshop.pems.checkgroup.UpdateCheckGroup;

import javax.validation.constraints.*;
import java.util.Date;

/**
 * 假期模型。
 * Created by wlc on 2017/7/5.
 */
public class HolidayModel {
    @Null(message = "假期ID只能为null。",
            groups = {CreateCheckGroup.class, PatchCheckGroup.class})
    @NotNull(message = "假期ID不能为null。",
            groups = UpdateCheckGroup.class)
    @Min(value = 1,
            message = "不正确的假期ID[${validatedValue}]。",
            groups = UpdateCheckGroup.class)
    private Long id;
    @NotNull(message = "假期不能为null。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class})
    private Date holiday;
    @Size(max = 128,
            message = "假期名称长度应该不大于{max}。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class, PatchCheckGroup.class})
    private String name;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getHoliday() {
        return holiday;
    }

    public void setHoliday(Date holiday) {
        this.holiday = holiday;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
